-- GENERATED SPELL FOR [Shade of Naxxramas] --


function spell0_16164(pUnit, Event) --@Portal of Shadows,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(28383,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_16164', 1, 1)
end

function spell1_16164(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(28407,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16164', 610, 1)
end

function spell2_16164(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(55323,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16164', 650, 1)
end

function Sorts_16164(pUnit, Event)
local choix_sorts_16164 = math.random(0, 2)
if choix_sorts_16164 == 0 then
pUnit:RegisterEvent('spell0_16164', 1, 1)
end
if choix_sorts_16164 == 1 then
pUnit:RegisterEvent('spell1_16164', 1, 1)
end
if choix_sorts_16164 == 2 then
pUnit:RegisterEvent('spell2_16164', 1, 1)
end
end

function mob16164_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16164', math.random(1500, 3000), 1)
end

function mob16164_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16164_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16164_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16164, 1, 'mob16164_Action')
RegisterUnitEvent(16164, 2, 'mob16164_Leave')
RegisterUnitEvent(16164, 3, 'mob16164_Kill')
RegisterUnitEvent(16164, 4, 'mob16164_Die')
